package com.handpay.nocardpay.baselibrary.logutils;


public class StringUtility
{
    public static String join(String separator, Object... values)
    {
        StringBuilder sb = new StringBuilder();
        boolean first = true;
        for(Object v : values)
        {
            if (first)
            {
                first = false;
            }
            else
            {
                sb.append(separator);
            }
            sb.append(v.toString());
        }
        return sb.toString();
    }

    public static String join(String separator, Iterable<String> values)
    {
        StringBuilder sb = new StringBuilder();
        boolean first = true;
        for(String v : values)
        {
            if (first)
            {
                first = false;
            }
            else
            {
                sb.append(separator);
            }
            sb.append(v);
        }
        return sb.toString();
    }

}
